package com.foundryx.shared.exception;

import java.util.HashMap;
import java.util.Map;

/**
 * @className: ExceptionContext
 * @author: ocxz1
 * @date: 2025/6/20 上午11:32
 * @Version: 1.0
 * @description: fx-share-resources 异常上下文信息，可用于记录日志时携带额外信息
 */
public class ExceptionContext {

    private final Map<String, Object> context = new HashMap<>();

    public void put(String key, Object value) {
        context.put(key, value);
    }

    public Object get(String key) {
        return context.get(key);
    }

    public Map<String, Object> getAll() {
        return new HashMap<>(context);
    }
}
